﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MapViewer.Loaders
{
	class FileLoader : ILoader
	{
		#region ILoader Members

		public void Load(Action<NamedBinaryTag.TagFile> callback, Model.RecentItem source)
		{
			NamedBinaryTag.TagFile target = new NamedBinaryTag.TagFile();
			using (System.IO.FileStream file = new System.IO.FileStream((source as Model.FileRecentItem).FilePath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read))
			{
				target.Load(file);
			}
			callback(target);
		}

		#endregion
	}
}
